Advanced Video Coding (AVC) and Motion Picture Expert Group (MPEG) encoders transport one or more compressed audio elementary streams (AESs) into a multiplexer that outputs the compressed AESs. The encoders typically compress the audio from raw Pulse Code Modulation (PCM) samples or pass through audio from a pre-compressed AES. The pre-compressed AES is typically input to the encoder under Audio Engineering Society-European Broadcasting Union (AES-EBU) standards or is embedded in the video elementary stream through the Society of Motion Picture and Television Engineers (SMPTE) 339 standard. When the audio is pre-compressed, the AES has previously been compressed at one of several different audio data bit rates. As such, the encoders are required to obtain bit rates of the pre-compressed AES to identify how much data to extract from the pre-compressed AES and to multiplex and transmit the audio packets.
In one current method, the encoder reads the length field from the SMPTE 339 packet to determine how much data to extract from the AES. Oftentimes, however, the AES is corrupted due to poor signal quality or an input switchover. The length field is also typically corrupted in these instances, which often causes the data transfer to the multiplexer to overflow and the audio data bit rate to exceed an expected rate.
Multiplexers typically transmit each Packetized Elementary Stream (PES) based on a time schedule. If the pre-compressed audio data bit rate changes while the AES is transported to the multiplexer, the PES size will also change. However, the time schedule for transmissions of each PES will remain the same. If there is a corruption in the preamble length fields in the pre-compressed AES, an incorrect amount of data will be sent to the multiplexer. More particularly, if the audio data bit rate sent to the multiplexer is greater than the maximum audio data bit rate, the audio data sent to the multiplexer will overflow. This is likely to cause a non-recoverable error since the write pointer overruns the read pointer in the buffer from the extracted AES to the multiplexer.